#ifndef BILLIARDS_H
#define BILLIARDS_H

//STL
#include <vector>

//Game
#include "Game/Ball.h"
#include "Graphics/Drawable.h"
#include "Game/Factory.h"

using namespace Math;

/** Singleton. Controls game logic. */
class Billiards
{
	public:
			static const int MAX_BALLS=16;
			static Billiards* instance();

			void start();
			void animate(float seconds);

			void createGame();
			void createAssets();
			void createBalls();
			void createScene();

			//Ball Arrangement
			void arrangeBalls();
			void resetCueBall();

			Vector* cue;
			float speed;

	private:
			static Billiards* _instance;

			std::vector<Game::Ball*> _balls;
			Game::PoolTable* _poolTable;
			Graphics::Drawable* _scene;
			Point _root;

			Game::Ball* _8Ball;
			Game::Ball* _cueBall;

			int _fps;
			int _mspf;

			Billiards();
			static void _tick(int userdata=1);
};

#endif
